import { FormType, MaskOpacity } from '../UIFrame/config/SysDefine';
import UIBase from "../UIFrame/UIBase";
import { EventCenter } from '../UIFrame/EventCenter';
import PageOne from './PageOne';
const { ccclass, property } = cc._decorator;

@ccclass
export default class UITitle extends UIBase {

    formType = FormType.FixedUI;

    canDestory = true;

    static prefabPath = "UIForm/UITitle";
    @property(cc.Label) title = null

    /** 下面表示 生命周期顺序 */
    async load() {
        cc.log('load');
        // 在这里执行你的加载操作
    }

    onShow(a: number, b: number, c: number) {
        // 初始化操作
        cc.log('onShow');
        console.log(a, b, c);
    }


    start() {
        cc.log('start')
        EventCenter.on("add", (number: number) => {
            console.log("add ", number);
        }, this);
    }

    async onClickOpen2UI() {
        let hallSetting2 = await PageOne.openView();
        let result = await hallSetting2.waitPromise();
        if (result) {
            this.closeUIForm();
        }
    }
}